package com.guochuang.yunwang.promanager.dao;

import com.guochuang.yunwang.promanager.domain.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface RoleMapper {

    Integer addNewRole(Role role);

    Integer deleteRoleById(Integer id);
    Integer deleteRoleByIds(List<Integer> ids);
    Integer updateRoleById(Role role);

    List<Role> getRoleByName(String rname);

    Role getRoleById(Integer id);

    List<Role> findAllRoles();

    Integer delRoleAuthByRid(Integer rid);

    Integer insertRoleAuths(@Param(value = "rid") Integer rid,
                            @Param(value = "aids") List<Integer> aids);

    Integer selRidbyRname(Role role);

    List<Role> getAllRoles();

    List<Integer> getRoleAuthByRid(Integer rid);
}
